<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title></title>
    <th:block th:include="statics/common/page/header"></th:block>
</head>
<body>
<div id="workflow" v-cloak>
	<div v-show="showList">
        <Row class="search-panel-space">
            <div  class="search-group">
                <i-col span="5" :xs="{ span: 12}" :md="{span: 8}" :lg="{ span: 6 }">
                	<label class="search-label-20">流程名称:</label>
                    <i-input v-model="q.name" @on-enter="query" placeholder="流程名称" class="search-item-width-75"/>
                </i-col>
                <i-col span="5" :xs="{ span: 12}" :md="{span: 8}" :lg="{ span: 6 }">
                    <label class="search-label-20">门店:</label>
                    <i-select v-model="q.branchId"  placeholder="门店" class="search-item-width-75" filterable @on-change="query">
                        <i-option v-for="vo in branchAll" :value="vo.branchId" :key="vo.branchId">{{vo.branchName}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                <!--  <i-button type="info" @click="add"> -->
                <i-button type="info" @click="add" th:if="${@shiroAuthService.hasPermission('workflow:info:save')}">
                    <i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <!-- <i-button type="warning" @click="update"> -->
                <i-button type="warning" @click="update" th:if="${@shiroAuthService.hasPermission('workflow:info:update')}">
                    <i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <!-- <i-button type="error" @click="del"> -->
                <i-button type="error" @click="del" th:if="${@shiroAuthService.hasPermission('workflow:info:delete')}">
                    <i class="fa fa-trash-o"></i>&nbsp;冻结</i-button>
            </div>
        </Row>
	    <table id="workflowGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title" style="height: 100%;">{{title}}
            <i-button type="warning" @click="reload" style="float: right;"/>返回</i-button>
        </p>
        <div style="width: 80%;">
            <i-form ref="formValidate" :model="workflowInfo" :rules="ruleValidate" :label-width="150">
                <Form-item label="流程编码" prop="code" v-if="!workflowInfo.id">
                    <i-select v-model="workflowInfo.code" filterable placeholder="流程编码">
                        <i-option v-for="(value,key) in BusinessTypeList" :value="key" :key="key">{{value}}
                        </i-option>
                    </i-select>
                </Form-item>
                <Form-item label="所属部门" prop="departId" v-if="!workflowInfo.id">
                    <i-input v-model="workflowInfo.departName" placeholder="所属部门" disabled icon="eye" @on-click="selectDepartList"/>
                </Form-item>
                <Form-item label="所属部门" prop="departId" v-if="workflowInfo.id">
                	所属部门：{{workflowInfo.departName}}&nbsp;&nbsp;&nbsp;所属门店：{{workflowInfo.branchName}} 
                </Form-item>
                <!--<Form-item label="流程名称" prop="name">-->
                    <!--<i-input v-model="workflowInfo.name" placeholder="流程名称"/>-->
                <!--</Form-item>-->
                <Form-item label="流程步骤" prop="stepList">
                    <i-button type="primary" shape="circle" icon="ios-add" @click="selectCompanyEmployeeOne" v-if="!workflowInfo.id">添加审核人</i-button>
                    <i-button type="error" shape="circle" icon="ios-trash-outline" @click="delCompanyEmployeeOne" v-if="!workflowInfo.id">移除审核人</i-button>
                    <steps :current="0" direction="vertical">
                        <step title="开始"></step>
                        <step v-for="auditEmployee in workflowInfo.auditEmployeeList" :title="auditEmployee.name"></step>
                        <!-- <step title="结束"></step> -->
                    </steps>
                </Form-item>
                <Form-item label="抄送人" prop="copyEmployeeList">
                    <i-button type="primary" shape="circle" icon="ios-search" @click="selectCompanyEmployee">选择抄送人</i-button>
                    <tag v-for="copyEmployee in workflowInfo.copyEmployeeList" type="dot" color="warning" :key="copyEmployee.id" :name="copyEmployee.id" closable @on-close="handlecopyEmployee">{{copyEmployee.name}}</tag>
                </Form-item>
                <Form-item>
                    <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                    <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
                </Form-item>
            </i-form>
        </div>
	</Card>
</div>
<div id="orgCompanyArchitectureLayer" style="display: none;padding:10px;">
	<ul id="architectureChangeTree" class="ztree"></ul>
</div>
<script th:src="@{../statics/js/workflow/workflowinfo.js}"></script>
</body>
</html>